export function likeExpression(sqlField, values) {
  if (!values.length) {
    return [];
  }
  let _definitionExpression = values
    .reduce((r, current, i) => {
      r.push(`${sqlField} like '${current}%'`);
      return r;
    }, [])
    .join(' or ');
  return _definitionExpression;
  // WBS编码 like 'C1-1-1%' or WBS编码 like 'C1-1-3%'
}

export function inExpression(sqlField, values, { isNum, isNot } = { isNum: false, isNot: false }) {
  // if (!values.length) {
  //   return '';
  // }
  const valueArr = values.map(v => {
    return isNum ? `${v}` : `'${v}'`;
  });
  console.log(valueArr);
  return `${sqlField} ${isNot ? 'not in' : 'in'} (${valueArr.join(' , ')})`;
  //  `WBS编码 in ('占位占位')`
}
